From 5a95135f8ba61007bdf96fbf2e49ce009836f56a Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 3 Sep 2026 14:35:00 +0200 Subject: [PATCH] Make sure we use FORTIFY_SOURCE=3 as defined in the dpkg script. Last-Update: 2023-12-27 This fixes FTBFS Gbp-Pq: Name fortify-source-3.patch --- cmake/compilers/Clang.cmake | 2 +- cmake/compilers/GNU.cmake | 2 +- cmake/compilers/Intel.cmake | 2 +- thread_composability_manager/cmake/compilers/Clang.cmake | 2 +- thread_composability_manager/cmake/compilers/GNU.cmake | 2 +- thread_composability_manager/cmake/compilers/Intel.cmake | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake index 7336bb9..3f9bdb5 100644 --- a/cmake/compilers/Clang.cmake +++ b/cmake/compilers/Clang.cmake @@ -105,7 +105,7 @@ endif() set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS}) if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE") - set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=2>) + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=3>) endif () if (MINGW) diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake index 719d736..79bae43 100644 --- a/cmake/compilers/GNU.cmake +++ b/cmake/compilers/GNU.cmake @@ -118,7 +118,7 @@ if (NOT APPLE AND NOT MINGW) set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack) endif() if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE") - set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=2> ) + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=3> ) endif () if (TBB_FILE_TRIM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel") diff --git a/cmake/compilers/Intel.cmake b/cmake/compilers/Intel.cmake index 531e078..a1bf702 100644 --- a/cmake/compilers/Intel.cmake +++ b/cmake/compilers/Intel.cmake @@ -23,7 +23,7 @@ elseif (APPLE) set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security $<$>:-fno-omit-frame-pointer -qno-opt-report-embed>) if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE") - set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=2>) + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=3>) endif () set(TBB_OPENMP_FLAG -qopenmp) diff --git a/thread_composability_manager/cmake/compilers/Clang.cmake b/thread_composability_manager/cmake/compilers/Clang.cmake index b1f7aea..339bbb7 100644 --- a/thread_composability_manager/cmake/compilers/Clang.cmake +++ b/thread_composability_manager/cmake/compilers/Clang.cmake @@ -14,7 +14,7 @@ set(TCM_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor -Wno-error=deprecated-declarations) set(TCM_COMPILE_DEFINITIONS "") -set(TCM_COMMON_COMPILE_FLAGS ${TCM_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=2> +set(TCM_COMMON_COMPILE_FLAGS ${TCM_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=3> -Wformat -Wformat-security -Werror=format-security -fPIC -fstack-protector-strong) set(TCM_LIB_COMPILE_FLAGS $<$>:-flto> -fstack-clash-protection -fcf-protection=full) diff --git a/thread_composability_manager/cmake/compilers/GNU.cmake b/thread_composability_manager/cmake/compilers/GNU.cmake index 3065c3e..1f6c5e2 100644 --- a/thread_composability_manager/cmake/compilers/GNU.cmake +++ b/thread_composability_manager/cmake/compilers/GNU.cmake @@ -25,7 +25,7 @@ endif() # Gnu flags to prevent compiler from optimizing out security checks set(TCM_COMMON_COMPILE_FLAGS ${TCM_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv - -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong $<$>:-D_FORTIFY_SOURCE=2>) + -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong $<$>:-D_FORTIFY_SOURCE=3>) set(TCM_LIB_COMPILE_FLAGS $<$>:-flto> $<$>:-fcf-protection=full>) diff --git a/thread_composability_manager/cmake/compilers/Intel.cmake b/thread_composability_manager/cmake/compilers/Intel.cmake index 5e45e7f..61f036b 100644 --- a/thread_composability_manager/cmake/compilers/Intel.cmake +++ b/thread_composability_manager/cmake/compilers/Intel.cmake @@ -12,6 +12,6 @@ else() # from statically linked libraries set(TCM_LIB_LINK_FLAGS ${TCM_LIB_LINK_FLAGS} -static-intel -Wl,-z,relro,-z,now,--exclude-libs,ALL) set(TCM_COMMON_COMPILE_FLAGS ${TCM_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security - $<$>:-qno-opt-report-embed -D_FORTIFY_SOURCE=2>) + $<$>:-qno-opt-report-embed -D_FORTIFY_SOURCE=3>) set(TCM_VISIBILITY_INLINES_HIDDEN_FLAG -fvisibility-inlines-hidden) endif() -- 2.39.5